#include<stdio.h>

struct ListNode {
     int val;
     struct ListNode *next;
 };
 
struct ListNode* deleteDuplicates(struct ListNode* head){
    if(!head)return NULL;
    struct ListNode*cur=head;
    struct ListNode*next=head->next;
    while(next)
    {
        if(cur->val==next->val)
        {
            cur->next=next->next;
        }
        else {
            cur=cur->next;
            next=next->next;
        }
    }
    return head;




}